app.controller("configController",function($scope, $location, $controller, configService){
    $controller('baseController',{$scope:$scope,baseService:configService});


    $scope.batchEdit = function(){
        configService.batchEdit({others: $scope.config}).success(function (res) {
            $scope.resHandler(res, function (res) {
                alert("修改成功");
                location.reload();
            });
        });
    };

    $scope.editInit = function () {
        configService.findAll().success(function (res) {
            $scope.resHandler(res,function (res) {
                $scope.config = {};
                for(i in res.data){
                    var config = res.data[i];
                    $scope.config[config.name] = config.value;
                }
            })
        });
    }
});
